<template>
  <div class="container">
    <div class="app-container">
      <div class="left">
        <div class="left-main">
          <el-tree
            :data="data"
            :props="defaultProps"
            accordion
            highlight-current
            :indent="40"
            icon-class="el-icon-circle-plus-outline"
            @node-click="handleNodeClick"
          />
        </div>
      </div>
      <div class="right">

        <div class="bottom">
          <nav class="bottom-nav">
            <h3>作业范围</h3>
          </nav>
          <div class="bottom-main">
            <div class="img">
              <!-- <img src="../../../assets/images/机构管理/empty.3697dcd2.png" alt=""> -->
              <ditu :list="list" />
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { hall } from '@/api/user'
import ditu from './ditu.vue'
export default {
  name: 'OrganizationManage',
  components: { ditu },
  data() {
    return {
      list: {},
      center: { lng: 0, lat: 0 },
      zoom: 0,
      form: {
        name: '',
        region: ''
      },
      data: [

      ],
      defaultProps: {
        children: 'children',
        label: 'name'
      },
      rules: {
        name: [
          { required: true, message: '请输入活动名称', trigger: 'blur' },
          { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
        ]
      }
    }
  },
  created() {
    this.hId()
  },
  methods: {
    handler({ BMap, map }) {
      console.log(BMap, map)
      this.center.lng = 121.487899486
      this.center.lat = 31.24916171
      this.zoom = 15
    },

    async  hId() {
      const res = await hall()
      this.data = JSON.parse(res.data.data)
      // console.log(res)
      // this.data = res.data.data
      // this.data = transListToTreeData(this.arr, 1)
      // console.log()
    },
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          alert('submit!')
        } else {
          console.log('error submit!!')
          return false
        }
      })
    },
    handleNodeClick(data) {
      console.log(data)
      this.list = data
    }
  }
}
</script>
<style lang="scss" scoped>
.map{
	width: 800px;
	height: 900px;
}
    *{
        padding: 0;
        margin: 0;
    }
   ::v-deep .el-input__inner{
        background-color: #f5f7fa !important;
    }
    .app-container{
        display: flex;
        padding: 20px;
        .left{
            height: 1000px;
            margin-right: 30px;
            background-color: #fff;
            padding: 20px 18px;
            .left-main{
               ::v-deep .el-tree-node{
                    margin-bottom: 10px;
                    width: 230px;
                }
            }
        }
        .right{
            height: 1000px;
            margin-left: 20px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            .top{
            width: 1200px;
            height: 2080px;
            background-color: #fff;
                .top-nav{
                    height: 55px;
                    background-color: #fafafa;
                    font-size: 16px;
                    line-height: 55px;
                    border-bottom: 1px solid #ebeef5;
                    padding-left:18px ;
                }
                .top-main{
                    padding: 20px 15px;
                }
                .el-button{
                    width: 80px;
                    height: 35px;
                    margin-top: 40px ;
                    margin-left: 350px;
                    background-color: #e15536;
                    border: 1px solid #e15536;
                }
                .form1{
                    display: flex;
                }
                .city{
                    display: flex;
                    justify-content: flex-start;
                    margin-top:15px ;
                    .el-form-item{
                        width: 282px;
                    }
                }
                .form2{
                    display: flex;
                    margin-top:15px ;
                }
                .form3{
                    display: flex;
                     margin-top:15px ;

                }
            }
            .bottom{
            width: 1200px;
            height:2000px;
            background-color: #fff;
                .bottom-nav{
                    height: 55px;
                    background-color: #fafafa;
                    font-size: 16px;
                    line-height: 55px;
                    border-bottom: 1px solid #ebeef5;
                    padding-left:18px ;
                }

            }
        }
    }
    .img{
      padding: 20px;
    }
</style>
